package com.emperor.role.logic;

import java.util.ArrayList;
import java.util.List;

import com.emperor.core.logic.BizModelBase;

public class RoleModel extends BizModelBase implements Role {
	
	private Long id;
	private String name;
	private String status;
	
	/* (non-Javadoc)
	 * @see com.emperor.role.logic.Role#getId()
	 */
	public Long getId() {
		return id;
	}
	/* (non-Javadoc)
	 * @see com.emperor.role.logic.Role#setId(java.lang.Object)
	 */
	public void setId(Object id) {
		if (id != null) {
			if (id instanceof Long) {
				this.id = (Long) id;
			} else {
				try {
					this.id = new Long(id.toString());
				} catch (Exception e) {
				}
			}
		}
	}
	/* (non-Javadoc)
	 * @see com.emperor.role.logic.Role#getName()
	 */
	public String getName() {
		return name;
	}
	/* (non-Javadoc)
	 * @see com.emperor.role.logic.Role#setName(java.lang.Object)
	 */
	public void setName(Object name) {
		if (name != null) {
			if (name instanceof String) {
				this.name = (String) name;
			} else {
				try {
					this.name = name.toString();
				} catch (Exception e) {
				}
			}
		}
	}
	/* (non-Javadoc)
	 * @see com.emperor.role.logic.Role#getStatus()
	 */
	public String getStatus() {
		return status;
	}
	/* (non-Javadoc)
	 * @see com.emperor.role.logic.Role#setStatus(java.lang.Object)
	 */
	public void setStatus(Object status) {
		if (status != null) {
			if (status instanceof String) {
				this.status = (String) status;
			} else {
				try {
					this.status = status.toString();
				} catch (Exception e) {
				}
			}
		}
	}
	@Override
	public List<String> getFieldNames() {
		List<String> fieldNames = new ArrayList<String>();
		
		fieldNames.add(Role.FLD_ID);
		fieldNames.add(Role.FLD_NAME);
		fieldNames.add(Role.FLD_STATUS);
		
		fieldNames.add(Role.FLD_CRTBY);
		fieldNames.add(Role.FLD_CRTDATE);
		fieldNames.add(Role.FLD_UPDBY);
		fieldNames.add(Role.FLD_UPDDATE);
		
		return fieldNames;
	}
	
	
}
